package com.cll.prototype.captcha.controller.service.email;

import com.cll.prototype.common.dto.AjaxResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 描述信息:
 * 通过openfeign封装了对email微服务的调用
 * 更加符合面向接口的开发
 * @author CLL
 * @version 1.0
 * @date 2020/10/29 9:18
 */
@FeignClient(name = "service-email",
        qualifier = "sendEmailLogControllerFeignClient",
        path = "/send_email_log",
        fallback = SendEmailLogControllerFeignClientFallback.class)
public interface SendEmailLogControllerFeignClient {

    /**
     * 邮件微服务下发送注册验证码邮件接口
     * @param email 邮箱
     * @param captcha   验证码
     * @return  发送结果
     */
    @PostMapping(value = "/sendEmailCaptcha")
    public AjaxResult sendEmailCaptcha(@RequestParam("email") String email,
                                       @RequestParam("captcha") String captcha);
}